package pages.navigator;

import pages.*;
import utils.WebDriverWrapper;

/**
 * Created by Vadim on 6/10/14.
 */
public class MainNavigator {
    public static BasePage openPage(PageList page, WebDriverWrapper driver) throws Exception
    {
        switch (page)
        {
            case COMPUTERS:
                ComputersPage computersPage = new ComputersPage(driver);
                computersPage.open();
                return computersPage;
            case PHONES:
                PhonesPage phonesPage = new PhonesPage(driver);
                phonesPage.open();
                return phonesPage;
            case VIDEO:
                VideoPage videoPage = new VideoPage(driver);
                videoPage.open();
                return videoPage;
            case BT:
                BTPage btPage = new BTPage(driver);
                btPage.open();
                return btPage;
            case OUTDOORS:
                OutDoorsPage outDoorsPage = new OutDoorsPage(driver);
                outDoorsPage.open();
                return outDoorsPage;
            case KIDS:
                KidsPage kidsPage = new KidsPage(driver);
                kidsPage.open();
                return kidsPage;
            case HOUSE:
                HouseAndGardenPage houseAndGardenPage = new HouseAndGardenPage(driver);
                houseAndGardenPage.open();
                return houseAndGardenPage;
            case CAR:
                CarsPage carsPage = new CarsPage(driver);
                carsPage.open();
                return carsPage;
            case TICKETS:
                TicketsPage ticketsPage = new TicketsPage(driver);
                ticketsPage.open();
                return ticketsPage;
            case SHOES:
                ShoesPage shoesPage = new ShoesPage(driver);
                shoesPage.open();
                return shoesPage;
            default:
                throw new Exception();
        }
    }
}
